package com.example.demo.cn.tedu.sevrice;

import com.example.demo.cn.tedu.pojo.Tech;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TechSevriceImpl implements TechSevrice{
    @Autowired
    private Tech tech;
    @Override
    public Tech get(Integer id, String name, Integer salary, Double grade) {
        tech.setId(id);
        tech.setName(name);
        tech.setSalary(salary);
        tech.setGrade(grade);
        if (grade<0.6&&grade>0){
            tech.setAward(0.0);
        }else if (grade<0.8){
            tech.setAward(salary*0.2*0.7);
        }else if (grade<0.9){
            tech.setAward(salary*0.2);
        }else if(grade<1.0){
            tech.setAward(salary*0.2*1.5);
        }
        return tech;
    }
}
